<?php

namespace App;


use App\User;
use App\Supplier;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\DomCrawler\Form;

class Goods extends Model
{
    protected $fillable = ['title', 'url', 'reserve_price', 'supplier_id', 'max_commission_rate', 'pict_url', 'status', 'created_at', 'updated_at'];

    protected $primaryKey = 'goods_id';

    protected $casts = [
        'user_id' => 'int',
    ];

    public static function getCateogries()
    {
        return [
            1 => '时尚车主',
            2 => '潮女搭配师',
            3 => '居家巧匠',
            4 => '型男塑造师',
            5 => '户外行者',
            6 => '美食专家',
            7 => '数码极客',
            8 => '美妆老师',
            9 => '文娱先锋',
            10 => '母婴达人',
        ];
    }

	public function sup()
	{
		return $this->hasOne('App\Supplier', 'supplier_id', 'supplier_id');

	}
}
